<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<!doctype html>
<html>
<head>
<meta name="viewport"
	content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title></title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/icon.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui-mobile/themes/mobile.css"/>">
<link rel="stylesheet" type="text/css"
	href="<c:url value="/static/jquery-easyui/themes/default/easyui.css"/>">
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery-1.6.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/jquery.easyui.min.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.panel.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.datagrid.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/plugins/jquery.messager.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/ext-for-framework.js.jsp"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/jquery-easyui/locale/easyui-lang-zh_CN.js"/>"></script>
<script type="text/javascript"
	src="<c:url value="/static/js/common.js"/>"></script>
<script type="text/javascript">
	function initList(listDisplayEId) {
		$('#' + listDisplayEId).datagrid({
			nowrap : false,
			striped : true,
			collapsible : true,
			remoteSort : true,
			notSelectByRow : false,
			onLoadError : function() {
				$.messager.alert('错误', '获取数据失败，请与管理员联系！', 'error');
			},
			onClickRow : function(rowIndex) {
				$(".myrad").prop("checked", false);
				$(".myrad").eq(rowIndex).prop("checked", true);
			}
		});

	};
	$(document).ready(function() {
		initList('listDisplay');
	});
	//下拉框
	$(function() {

	});
	function searchInfo() {
		if ($('#materName').val() == '') {
			$.messager.alert('提示', '请填写材料名！', 'info');
			return false;
		}

		$('#listDisplay').datagrid('load', {
			initFlag : 1,
			materName : $('#materName').val()
		});

	}
</script>
</head>

<body>
	<header>
		<div class="m-toolbar">
			<span class="m-title">材料查询界面</span>
		</div>
	</header>
	<table>
		<tr width="100%">
			<td>
				<div
					style="height: auto; width: 100%; background: #fafafa; padding: 5px;"
					class="easyui-panel" title="查询" iconCls="icon-search"
					collapsible="true" minimizable="false" maximizable="false"
					closable="false">
					<form id="searchForm" name="searchForm" method="post"
						action="userlist.txt"
						onsubmit="return searchDGData(this.id,'listDisplay');">
						<div>
							<table cellpadding="5">
								<tr>
									<td>材料名称:</td>
									<td><input class="easyui-validatebox" id="materName"
										name="materName"></input></td>
								</tr>
								<tr>
									<td><input type="button" onclick="searchInfo()" value="查询"></td>
								</tr>

							</table>
						</div>
					</form>
				</div>
			</td>
		</tr>
		<tr>
			<td>
				<table id="listDisplay" title="材料列表" singleSelect=true width="100%"
					iconCls="icon-list" idField="id"
					url="<c:url value="/supplierDistribute/findMaterId.do"/>" loadMsg="请稍候......"
					pagination="true" pageSize="10" pageList="[10,20,30,40,50,100]"
					sortName="materId" rownumbers="false" sortOrder="asc">
					<thead>
						<tr>
							<th field="materId" width="80" sortable="true">材料id</th>
							<th field="materName" width="60" sortable="true">材料名</th>
							<th field="brands" width="40" sortable="true">品牌</th>
							<th field="specifications" width="60" sortable="true">规格</th>
							<th field="unit" width="40" sortable="true">单位</th>

						</tr>
					</thead>
				</table>
			</td>
		</tr>
	</table>
</body>
<style>
body {
	margin: 0;
	padding: 0;
}

.m-toolbar {
	position: relative;
	text-align: center;
	min-height: 32px;
	background-color: #e0edfe;
}

.datagrid-row {
	height: 32px;
}
</style>
</html>